package com.heima.article.controller;



import com.heima.article.service.ApArticleService;
import com.heima.model.article.dto.ArticleDto;
import com.heima.model.article.dto.ArticleHomeDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 * 文章基础信息表(ApArticle)表控制层
 *
 * @author makejava
 * @since 2023-06-15 21:21:03
 */
@RestController
@RequestMapping("/api/v1/article")
public class ApArticleController  {
    /**
     * 服务对象
     */
    @Resource
    private ApArticleService apArticleService;

    /**
     * 发布文章
     */
    @PostMapping("/save")
    public ResponseResult  saveArticle(@RequestBody ArticleDto dto){

        return apArticleService.saveArticle(dto);
    }


    @PostMapping("/load")
    public ResponseResult loadHomePage(@RequestBody ArticleHomeDto articleHomeDto){
        return apArticleService.loadHomePage(articleHomeDto);
    }

}

